//---------------------------------------------------------------------------------
#include <QApplication>
#include <QTranslator>
#include <QTextCodec>
#include <QLibraryInfo>
#include "CMainWindow.h"
//---------------------------------------------------------------------------------
int main(int argc, char *argv[]) {
	QTranslator translator;
	int res;
	int level=1;
	
	QApplication app(argc, argv);
	
	QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));
	QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf8"));

	translator.load(QString("qt_fr"), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
	
	app.installTranslator(&translator);
	
	if(argc > 1) {
		level=QString(argv[1]).toInt();
		if(level <= 0) {
			level=1;
		}
	}
	
	CMainWindow *mainWindow=new CMainWindow(level);
	
	mainWindow->showMaximized();
	
	res=app.exec();
	
	delete mainWindow;
	
	return res;
}
//---------------------------------------------------------------------------------